<?php
defined('IN_WSLM') or exit('Access Denied');
if(!defined('ROUT_M')) define('MOD_ROOT', substr(dirname(__FILE__), 0, -7));

$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(5, '视频', '', '', '', 'right', '', '', '', '', 1, 0, 0, 0, '')");
$parentid = $db->insert_id();

$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '栏目管理', '', '?mod=video&file=category', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '上传视频', '', '?mod=video&file=video&action=add', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '管理视频', '', '?mod=video&file=video&action=manage', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '视频统计', '', '?mod=video&file=stat', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '专辑管理', '', '?mod=video&file=special', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '模块配置', '', '?mod=video&file=setting', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '权限配置', '', '?mod=video&file=priv', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '字段管理', '', '?mod=video&file=field', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");

$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES(7, '视频', '', '', '', 'right', '', '', '', '', 1, 0, 0, 0, '')");
$parentid = $db->insert_id();

$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '管理模板', '', '?mod=wslm&file=template&action=manage&module=video', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '添加模板', '', '?mod=wslm&file=template&action=add&module=video', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '标签管理', '', '?mod=video&file=tag&action=manage', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");
$db->query("INSERT INTO `".DB_PRE."menu` (`parentid`, `name`, `image`, `url`, `description`, `target`, `style`, `js`, `groupids`, `roleids`, `isfolder`, `isopen`, `listorder`, `userid`, `keyid`) VALUES($parentid, '添加标签', '', '?mod=video&file=tag&action=add', '', 'right', '', '', '', '', 0, 0, 0, 0, '')");


$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'show', 0, 'show.php?vid={\$vid}|show.php?vid={\$vid}&page={\$page}', 'show.php?vid=1&page=2')");
$rid_1 = $db->insert_id();

$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'category', 0, 'list.php?catid={\$catid}|list.php?catid={\$catid}&page={\$page}', 'list.php?catid=1&page=2')");
$rid_2 = $db->insert_id();

$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'special', 0, 'special.php?specialid={\$specialid}|special.php?specialid={\$specialid}&page={\$page}', 'special.php?special=1')");
$rid_3 = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'specialpage', 0, 'special.php', 'special.php?page=1')");
$rid_4 = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'specialshow', 0, 'specialvideo-{\$vid}-{\$specialid}.html', 'show.php?vid=1&specialid=1')");
$rid_5 = $db->insert_id();

$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'special', 0, 'specialid-{\$specialid}-{\$page}.html', 'specialid-1-1.html')");
$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'show', 0, 'video-{\$vid}.html', 'video-1.html')");
$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'category', 0, 'video-list-{\$catid}-{\$page}.html', 'video-list-1-1.html')");
$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'specialshow', 0, 'specialvideo-{\$vid}-{\$specialid}.html', 'specialvideo-1-1.html')");

$db->query("INSERT INTO `".DB_PRE."urlrule` (`module`, `file`, `ishtml`, `urlrule`, `example`) VALUES('video', 'specialpage', 0, 'specialid--{\$page}.html', 'specialid--1.html')");
//插入模型信息
$db->query("INSERT INTO `".DB_PRE."model` (`name`, `description`, `tablename`, `itemname`, `itemunit`, `workflowid`, `template_category`, `template_list`, `template_show`, `template_print`, `ishtml`, `category_urlruleid`, `show_urlruleid`, `enablesearch`, `ischeck`, `isrelated`, `disabled`, `modeltype`) VALUES('视频模块', '独立视频模块', 'data', '视频', '条', 1, 'category_video', 'list_video', 'show_video', 'print', 0, 0, 0, 1, 1, 1, 0, 10)");
$modelid = $db->insert_id();
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'vid', '视频ID', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''0'',\n  ''maxnumber'' => '''',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'catid', '栏目', '', '', 1, 6, '/^[0-9]{1,6}$/', '请选择栏目', 'catid', 'array (\n  ''defaultvalue'' => '''',\n)', 'require=\"true\" compare=\">0\" datatype=\"compare\" msgid=\"specialmsg\" msg=\"请选择所属类别\"', '-99', '-99', 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'timelen', '视频时长', '', '', 0, 0, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => ''10'',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 13, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'title', '标题', '', 'inputtitle', 1, 80, '', '', 'title', 'array (\n  ''size'' => ''80'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 4, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'style', '颜色和字型', '', '', 0, 0, '', '', 'style', '', '', '-99', '-99', 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 5, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'thumb', '缩略图', '', '', 0, 100, '', '', 'image', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''upload_maxsize'' => ''1024'',\n  ''upload_allowext'' => ''jpg|jpeg|gif|png|bmp'',\n  ''isselectimage'' => ''1'',\n  ''isthumb'' => ''1'',\n  ''thumb_width'' => ''300'',\n  ''thumb_height'' => ''300'',\n  ''iswatermark'' => ''1'',\n  ''watermark_img'' => ''images/watermark.gif'',\n)', '', '', '', 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 6, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'keywords', '关键词', '多关键词之间用空格隔开', '', 0, 40, '', '', 'keyword', 'array (\n  ''size'' => ''50'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 7, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'author', '作者', '', '', 0, 30, '', '', 'author', 'array (\n  ''size'' => ''30'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 8, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'copyfrom', '来源', '', '', 0, 0, '', '', 'copyfrom', 'array (\n  ''size'' => ''30'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 9, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'description', '摘要', '', '', 0, 255, '', '', 'textarea', 'array (\n  ''rows'' => ''4'',\n  ''cols'' => ''50'',\n  ''defaultvalue'' => '''',\n  ''enablekeylink'' => ''0'',\n  ''replacenum'' => '''',\n)', 'style=\"width:80%\"', '-99', '-99', 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 10, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'userid', '发布人', '', '', 0, 0, '', '', 'userid', '', '', '', '', 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 11, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'updatetime', '更新时间', '', '', 0, 0, '', '', 'datetime', 'array (\r\n  ''dateformat'' => ''int'',\r\n  ''format'' => ''Y-m-d H:i:s'',\r\n  ''defaulttype'' => ''1'',\r\n  ''defaultvalue'' => '''',\r\n)', '', '', '', 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 12, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'content', '内容', '', '', 1, 999999, '', '', 'editor', 'array (\n  ''toolbar'' => ''standard'',\n  ''width'' => ''100%'',\n  ''height'' => ''150'',\n  ''defaultvalue'' => '''',\n  ''storage'' => ''database'',\n  ''enablekeylink'' => ''1'',\n  ''replacenum'' => ''2'',\n  ''enablesaveimage'' => ''1'',\n)', '', '-99', '-99', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 13, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'islink', '转向链接', '', '', 0, 0, '', '', 'islink', '', '', '-99', '-99', 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 14, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'inputtime', '发布时间', '', '', 0, 0, '', '', 'datetime', 'array (\n  ''dateformat'' => ''int'',\n  ''format'' => ''Y-m-d H:i:s'',\n  ''defaulttype'' => ''1'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 15, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'posids', '推荐位', '全选<input boxid=''posids'' type=''checkbox'' onclick=\"checkall(''posids'')\" >', '', 0, 0, '', '', 'posid', 'array (\n  ''cols'' => ''4'',\n  ''width'' => ''125'',\n)', '', '', '', 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 16, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'groupids_view', '阅读权限', '全选<input boxid=''groupids_view'' type=''checkbox'' onclick=\"checkall(''groupids_view'')\" >', '', 0, 0, '', '', 'groupid', 'array (\n  ''priv'' => ''view'',\n  ''cols'' => ''4'',\n  ''width'' => ''125'',\n)', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'readpoint', '阅读所需点数', '', '', 0, 5, '', '', 'number', 'array (\n  ''minnumber'' => ''1'',\n  ''maxnumber'' => ''99999'',\n  ''decimaldigits'' => ''0'',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 18, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'listorder', '排序', '', '', 0, 6, '', '', 'number', '', '', '', '', 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 97, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'status', '状态', '', '', 0, 2, '', '', 'box', '', '', '', '', 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 98, 0)");
$db->query("INSERT INTO `".DB_PRE."model_field` (`modelid`, `field`, `name`, `tips`, `css`, `minlength`, `maxlength`, `pattern`, `errortips`, `formtype`, `setting`, `formattribute`, `unsetgroupids`, `unsetroleids`, `iscore`, `issystem`, `isunique`, `isbase`, `issearch`, `isselect`, `iswhere`, `isorder`, `islist`, `isshow`, `isadd`, `isfulltext`, `listorder`, `disabled`) VALUES($modelid,'template', '内容页模板', '', '', 0, 30, '', '', 'template', 'array (\n  ''size'' => '''',\n  ''defaultvalue'' => '''',\n)', '', '-99', '-99', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0)");

$db->query("INSERT INTO `".DB_PRE."category` (`module`, `type`, `modelid`, `parentid`, `arrparentid`, `child`, `arrchildid`, `catname`, `style`, `image`, `description`, `parentdir`, `catdir`, `url`, `content`, `items`, `hits`, `setting`, `listorder`, `ismenu`, `letter`, `citems`, `pitems`) VALUES('wslm', 2, 0, 0, '0', 0, '', '视频', '', '', '', '', '', 'video/', '', 0, 0, '', '502', 1, '', 0, 0)");
$catid = $db->insert_id();

$db->query("INSERT INTO `".DB_PRE."module` (`module`, `name`, `path`, `url`, `iscore`, `version`, `author`, `site`, `email`, `description`, `license`, `faq`, `tagtypes`, `setting`, `listorder`, `disabled`, `publishdate`, `installdate`, `updatedate`) VALUES('video', '视频', '', 'video/', 0, '1.0.0', 'phpip', 'http://www.wslm.cn', 'phpip@live.cn', '<p>与 ku6vms 系统整合，将视频上传到 ku6 ，所有视频保存到 ku6，不占用客户任何带宽和空间。</p>', '<br />', '<br />', '', 'array (\n  ''skey'' => '''',\n  ''sn'' => '''',\n  ''style_projectid'' => '''',\n  ''specialUrlRuleid'' => ''$rid_3'',\n  ''sPageUrlRuleid'' => ''$rid_4'',\n  ''SUrlRuleid'' => ''$rid_5'',\n  ''modelid'' => ''$modelid'',\n  ''menu_selectid'' => ''$catid'',\n  ''allow_upload'' => ''1'',\n  ''check_video'' => ''1'',\n  ''categoryUrlRuleid'' => ''$rid_2'',\n  ''showUrlRuleid'' => ''$rid_1'',\n)', 0, 0, '2009-11-23', '2009-11-23', '2009-11-23')");